//
//  GBNetWorking+json.h
//  测试
//
//  Created by 李李善 on 2017/5/28.
//  Copyright © 2017年 森之源. All rights reserved.
//

#import "GBNetWorking.h"
#import <MJExtension/MJExtension.h>
#import "ZBCacheManager.h"
#import "NSFileManager+ZBPathMethod.h"
typedef NS_OPTIONS(NSUInteger, HTTPStatusCode) {
    HTTPStatusCode_200 = 200,
    HTTPStatusCode_400 = 400,
    HTTPStatusCode_401 = 401,
    HTTPStatusCode_500 = 500,
    HTTPStatusCode_601 = 601,
    HTTPStatusCode_602 = 602,
    HTTPStatusCode_603 = 603,
    HTTPStatusCode_610 = 610,
    HTTPStatusCode_611 = 611,
    HTTPStatusCode_612 = 612,
};

//Custom sample
static inline NSDictionary *HttpCodesDic(){
    return@{
            @"200":@"成功",
            @"400":@"错误请求(缺少参数,或者参数类型不符合条件,具体原因看返回内容)",
            @"401":@"未授权,需要重新登录",
            @"500":@"服务异常",
            @"601":@"XXXXXX",
            @"602":@"XXXXXX",
            @"603":@"XXXXXX",
            @"610":@"XXXXXX",
            @"611":@"XXXXXX",
            @"612":@"XXXXXX",
            };
}


@interface GBNetWorking (json)
/**
 *  请求参数类型
 *
 *  @param _success request result
 */
+ (void (^)())checkHTTPStatusCodeRequestSucceed:(void(^)(BOOL success))_success;


/**
 *  无返回参数类型 。错误处理
 *
 *  @param success request result
 */
+ (void (^)())checkHTTPStatusCode:(void(^)(BOOL success,NSError *error))success;


/**
 *请求结果（错误处理 解析数据）
 *
 *  @param success request result
 */
+ (void (^)())checkHTTPStatusCodeWithModel:(void(^)(BOOL success,NSError *error,id model))success;



//错误处理
+ (void (^)())checkHTTPErrorStatusCode :(void(^)(NSError *error))success;
@end
